<?php 
include("inc/conn.php");

$db=db_connect();
$menu=array();
$sql=select_sql("`typename`,`id`","`".PRETABLE."arctype`","`ishidden`='0' ORDER BY `sortrank`");
$rs=$db->query($sql) or die("datebase error!");

while($row=$rs->fetch_assoc()){
	$menu[]=$row;
}
$smarty->assign("menu",$menu);//调用导航


$top_arc=array();
$sql=select_sql("*","`".PRETABLE."arcmain`","`flag`='f' AND `isdel`='0' AND `ishidden`='0' ORDER BY `pubdate` DESC");
$rs=$db->query($sql) or die("datebase error!");

while($row=$rs->fetch_assoc()){
	$top_arc[]=$row;
}
$smarty->assign("top_arc",$top_arc);//调用头条

$new_arc=array();
$sql=select_sql("*","`".PRETABLE."arcmain`","`isdel`='0' AND `ishidden`='0' ORDER BY `pubdate` DESC");
$rs=$db->query($sql) or die("datebase error!");

while($row=$rs->fetch_assoc()){
	$new_arc[]=$row;
}
$smarty->assign("new_arc",$new_arc);//调用最新文章


$hy_arc=array();
$sql=select_sql("*","`".PRETABLE."arcmain`","`isdel`='0' AND `typeid`='42' AND `ishidden`='0' ORDER BY `pubdate` DESC");
$rs=$db->query($sql) or die("datebase error!");

while($row=$rs->fetch_assoc()){
	$hy_arc[]=$row;
}
$smarty->assign("hy_arc",$hy_arc);//调用行业


$pic_news=array();
$sql=select_sql("*","`".PRETABLE."arcmain`","`isdel`='0' AND `ishidden`='0' AND `flag` LIKE '%p%' ORDER BY `pubdate` DESC");
$rs=$db->query($sql) or die("datebase error!");
while($row=$rs->fetch_assoc()){
	$pic_news[]=$row;
}
$smarty->assign("pic_news",$pic_news);//调用图片文档

$about_news=array();
$sql=select_sql("*","`".PRETABLE."arcmain`","`isdel`='0' AND `ishidden`='0' AND `flag` LIKE '%about%' ORDER BY `pubdate` DESC");
$rs=$db->query($sql) or die("datebase error!");
while($row=$rs->fetch_assoc()){
	$about_news[]=$row;
}
$smarty->assign("about_news",$about_news);//调用关于我们

$bottom_news=array();
$sql=select_sql("*","`".PRETABLE."arcmain`","`isdel`='0' AND `ishidden`='0' AND `flag` LIKE '%bottom%' ORDER BY `pubdate` DESC");
$rs=$db->query($sql) or die("datebase error!");
while($row=$rs->fetch_assoc()){
	$bottom_news[]=$row;
}
$smarty->assign("bottom_news",$bottom_news);//调用底部文章




$img_rand=mt_rand(1,5);
$smarty->assign("img_rand",$img_rand);

?>